<template>
  <!--<head>-->
  <!--    <meta charset="UTF-8">-->
  <!--    <title>FirstPage</title>-->
  <!--    <link rel="stylesheet" type="text/css" href="page.css">-->
  <!--</head>-->
  <body class="first_page_body">
    <div class="first_page_body">
      <section class="first_page_section">
        <img src="../statics/bg.jpg" id="bg" />
        <img src="../statics/moon.png" id="moon" />
        <img src="../statics/mountain.png" id="mountain" />
        <img src="../statics/road.png" id="road" />
        <h2 id="text">Mute Melody</h2>
      </section>
      <h4>ABOUT US</h4>
      <p>
        We are a team aimed at making sign language learning accessible to the
        public and reducing communication costs for the deaf and mute.
      </p>
      <p>
        This application will use the camera for motion recognition to achieve
        sign language teaching, correction, and translation.
      </p>
      <p>
        Whether you are someone interested in sign language or a friend who is
        unable to speak, we will make every effort to provide functionalities
        suitable for everyone so that everyone can have a good experience within
        this application.
      </p>
      <!--    <p>-->
      <!--      我们是一个旨在让大众学习手语、降低聋哑人沟通成本的团队。本应用将使用摄像头对于动作进行识别以实现手语教学、纠正和翻译。无论是对于手语感兴趣的同好，还是受困于无法言说的友人，我们都将尽全力提供适合各位的功能使得大家在本应用内有良好的体验。-->
      <!--    </p>-->
      <div class="nextpageButton">
        <button @click="nextpage">
          <div class="svg-wrapper-1">
            <div class="svg-wrapper">
              <svg
                height="24"
                width="24"
                viewBox="0 0 24 24"
                xmlns="http://www.w3.org/2000/svg"
              >
                <path d="M0 0h24v24H0z" fill="none"></path>
                <path
                  d="M1.946 9.315c-.522-.174-.527-.455.01-.634l19.087-6.362c.529-.176.832.12.684.638l-5.454 19.086c-.15.529-.455.547-.679.045L12 14l6-8-8 6-8.054-2.685z"
                  fill="currentColor"
                ></path>
              </svg>
            </div>
          </div>
          <span>Next</span>
        </button>
      </div>
    </div>
  </body>
</template>

<script>
export default {
  name: "first_page",
  mounted() {
    this.myMethod();
  },
  methods: {
    nextpage() {
      console.log("seccess"),
        this.$router.push({
          path: "/login_signup",
        });
    },
    myMethod() {
      // 这里是你的方法逻辑
      let bg = document.getElementById("bg");
      let moon = document.getElementById("moon");
      let mountain = document.getElementById("mountain");
      let road = document.getElementById("road");
      let text = document.getElementById("text");

      window.addEventListener("scroll", function () {
        var value = window.scrollY;
        bg.style.top = value * 0.5 + "px";
        moon.style.left = -value * 0.5 + "px";
        mountain.style.top = -value * 0.15 + "px";
        road.style.top = value * 0.15 + "px";
        text.style.top = value + "px";
      });
    },
  },
};
</script>

<style scoped>
@import url("https://fonts.googleapis.com/css?family=Poppins:300,400,500,600,700,800,900&display=swap");
* {
  margin: 0;
  padding: 0;
  font-family: Poppins, sans-serif;
}
.first_page_body {
  background: #0a2a43;
  /* min-height: 1500px; */
}
.first_page_section {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}
.first_page_section:before {
  content: "";
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 100px;
  background: linear-gradient(to top, #0a2a43, transparent);
  z-index: 10000;
}
.first_page_section:after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #0a2a43;
  z-index: 10000;
  mix-blend-mode: color;
}
.first_page_section img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
#text {
  position: relative;
  color: #fff;
  font-size: 10em;
  z-index: 1;
}
#road {
  z-index: 2;
}
.first_page_body h4 {
  display: flex;
  font-size: 5em;
  position: center;
  color: #fff;
  /* padding-left: 30%; */
  padding-top: 30px;
  justify-content: center;
  align-items: center;
}
.first_page_body p {
  font-size: 1.2em;
  line-height: 1.5;
  position: center;
  color: #fff;
  text-indent: 2em;
  padding: 1em 10%;
}
.nextpageButton {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  padding-bottom: 100px;
}
.first_page_body button {
  font-family: inherit;
  font-size: 20px;
  background: royalblue;
  color: white;
  /* margin-left: 40%; */
  padding: 0.7em 1em;
  padding-left: 0.9em;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.2s;
}

.first_page_body button span {
  display: block;
  margin-left: 0.3em;
  transition: all 0.3s ease-in-out;
}

.first_page_body button svg {
  display: block;
  transform-origin: center center;
  transition: transform 0.3s ease-in-out;
}

.first_page_body button:hover .svg-wrapper {
  animation: fly-1 0.6s ease-in-out infinite alternate;
}

.first_page_body button:hover svg {
  transform: translateX(1.2em) rotate(45deg) scale(1.1);
}

.first_page_body button:hover span {
  transform: translateX(5em);
}

.first_page_body button:active {
  transform: scale(0.95);
}

@keyframes fly-1 {
  from {
    transform: translateY(0.1em);
  }

  to {
    transform: translateY(-0.1em);
  }
}

.first_page_body {
  animation-name: fly-1;
}
</style>
